<template>
  <div>
      <!--<div class="header">-->
          <!--header-->
      <!--</div>-->
      <v-header :seller="seller"></v-header>
      <div class="tab px">
          <div class="tab-item">
              <router-link to="/goods">商品</router-link>
          </div>
          <div class="tab-item">
              <router-link to="/comment">评论</router-link>
          </div>
          <div class="tab-item">
              <router-link to="/seller">商家</router-link>
          </div>
      </div>
    <!--内容-->
      <router-view></router-view>
  </div>
</template>

<script>
    import header from './components/header/header.vue'

    const ERR_OK = 200;

    export default{
        data(){
            return{
                seller:{}
            }
        },
        created(){
          this.$http.get('http://rap.taobao.org/mockjsdata/13941/api/seller')
          .then(function (response) {
              if(response.status == ERR_OK) {
                  this.seller = response.body.seller;
                  console.log(this.seller)
              }
          })
        },
        components: {
            'v-header': header
        }
    }
</script>

<style>
    .tab{
        display: flex;
        width:100%;
        height:40px;
        line-height: 40px;
    }
    .tab-item{
        flex: 1;
        text-align: center;
    }
    .tab-item>a{
        display: block;
        color: rgb(77,85,93);
    }
    .tab-item>a.active{
        display: block;
        color: rgb(240,20,20);
    }
</style>
